﻿<link href="@Url.Content("~/content/activitie_detail.css")" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="@Url.Content("~/plugin/css/pikaday.css")">
<link rel="stylesheet" href="@Url.Content("~/plugin/css/site.css")">
<script src="@Url.Content("~/plugin/moment.min.js")"></script>
<script src="@Url.Content("~/plugin/pikaday.js")"></script>

@model PessModel.ExpertJudge

@{
    ViewBag.Title = "Edit";
}

<div id="m-title">
    <h2>编辑评委信息</h2>
    <div id="m-op">
        @Html.ActionLink("返回", "Go2ReturnUrl", new { returnUrl = (object)ViewBag.ReturnUrl })
    </div>
</div>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset class="fly-edit">
        <legend class="f-warn">*评委首次登录请补充完整个人信息</legend>

        <div class="editor-label">
            评 委 组 ：
        </div>
        <div class="editor-field f-ck-mid">
            @{
    var expertGroupSelectionModel = (PessMvc.Models.ExpertGroupSelectionModel)ViewBag.ExpertGroupSelection;
    var expertGroups = expertGroupSelectionModel.ExpertGroups;
            }
            @if (Roles.IsUserInRole(Membership.GetUser().UserName, "Admin"))
            {
                for (int i = 0; i < expertGroups.Count(); i++)
                {
                    @Html.CheckBoxFor(m => expertGroups[i].IsSelected, new { @class = "check-box" })
                    @expertGroups[i].LocalName<span> </span>
                    @Html.HiddenFor(m => expertGroups[i].Id)
                    @Html.HiddenFor(m => expertGroups[i].Name)
                    
                }
            }
            else
            {
                if ((bool)ViewBag.HideArchiveDetails == false)
                {
                    for (int i = 0; i < expertGroups.Count; i++)
                    {
                        if (expertGroups[i].IsSelected)
                        {
                            @Html.Label(expertGroups[i].LocalName + ",")
                        }
                    }
                }
            }

        </div>

        <div class="editor-label">
            评委编号：
        </div>
        <div class="editor-field">
            @Html.DisplayFor(model => model.SerialNumber)
        </div>

        <div class="editor-label">
            @*@Html.LabelFor(model => model.RealName)*@真实姓名
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.RealName)
            @Html.ValidationMessageFor(model => model.RealName)
        </div>

        <div class="editor-label">
            @*@Html.LabelFor(model => model.Gender)*@性别
        </div>
        <div class="editor-field">
            @Html.DropDownList("Gender")
            @Html.ValidationMessageFor(model => model.Gender)
        </div>

        <div class="editor-label" style="display:none;">
            @*@Html.LabelFor(model => model.BirthDate)*@出生日期(不必填写)
            <input class="text-box single-line" id="BirthDate" name="BirthDate" type="text" value="@Html.DisplayFor(model => model.BirthDate)" />
            @Html.ValidationMessageFor(model => model.BirthDate)
        </div>

        <div class="editor-label">
            @*@Html.LabelFor(model => model.Phone)*@联系电话
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Phone)
            @Html.ValidationMessageFor(model => model.Phone)
        </div>

        <div class="editor-label">
            @*@Html.LabelFor(model => model.ContactAddress)*@通讯地址
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ContactAddress)
            @Html.ValidationMessageFor(model => model.ContactAddress)
        </div>

        <div class="editor-label">
            @*@Html.LabelFor(model => model.ZipCode)*@邮政编码
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ZipCode)
            @Html.ValidationMessageFor(model => model.ZipCode)
        </div>

        <div class="editor-label">
            @*@Html.LabelFor(model => model.Email)*@邮件地址
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>

        <div class="editor-label">
        </div>
        <div class="editor-field">
                @Html.Hidden("ReturnUrl", (object)ViewBag.ReturnUrl)
                @Html.Hidden("UserID", Model.UserID)
                @Html.Hidden("ExpertGroupID", Model.ExpertGroupID)
            <input type="submit" value="保存" class="u-btn u-btn-save3" />&#8195;
                @if (Roles.IsUserInRole("Admin"))
                {
                    @Html.ActionLink("重置密码", "ResetPassword", "Account", new
           {
               userName = Model.SerialNumber,
               returnUrl = HttpContext.Current.Request.RawUrl
           }, new { @class = "u-btn-a u-btn-reset" })
                }
</fieldset>
}

<script>
    var pikaday1 = new Pikaday({
        field: document.getElementById('BirthDate'),
        firstDay: 1,
        minDate: new Date('1905-01-01'),
        maxDate: new Date('2025-12-31'),
        yearRange: [1905, 2025],
        onSelect: function () { }
    });
</script>
